package com.zmn.plat.persistence.interfaces.key;

import com.zmn.plat.model.entity.key.BaseKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author duanzuocai
 * @version v1.0
 * @since 2019/1/18 14:57
 */
public interface KeyDao {
    /**
     * 查询KEY, 且更新为已读
     *
     * @param type: 1保修卡，2优惠券
     * @return key
     */
    String findOneRandomKey(@Param("type")Integer type);

    /**
     * 统计数量
     *
     * @param type
     * @return
     */
    int count(@Param("type")int type);

    /**
     * 添加随机码
     *
     * @param list
     * @return
     */
    void create(@Param("list")List<BaseKey> list);
}
